const express = require("express")
const router = express.Router()
const handlerFn = require("./handler/userinfo")
const expressJoi = require("@escook/express-joi")
const { reg_updateUserInfo, reg_modifyPassword, reg_updateAvatar } = require("../schema/user")

// 获取用户信息
router.get('/userinfo', handlerFn.handlerUserinfo)

// 更新用户信息
router.post('/updateUserInfo', expressJoi(reg_updateUserInfo), handlerFn.handlerUpdateUserinfo)

// 修改密码
router.post('/modifyPassword', expressJoi(reg_modifyPassword), handlerFn.handlerModifyPassword)

// 更新头像
router.post('/update/avatar', expressJoi(reg_updateAvatar), handlerFn.handlerUpdateAvatar)


module.exports = router
